home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nautilus 1994 March
/
Nautilus CD Magazine Volume 4-3 March 1994 Windows Edition.mdf
/
setup
/
nautcd
/
link
/
cserve.scr
< prev
next >
Wrap
Text File
|
1993-09-16
|
4KB
|
180 lines
!
! Copyright (c) 1993
! by CompuServe Incorporated, Columbus, Ohio
!
! The information in this software is subject to change without
! notice and should not be construed as a commitment by CompuServe.
!
! CSERVE:
! Connect to CIS.
! First argument is %TRUE if direct connect and %FALSE otherwise
! Success: returns %Success
! Failure: saves error msg in %FailureMsg and returns %Failure
! or %Fatal (depending on severity).
!
!+V
! "3.1"
!-V
DirectConnect = Arg1;
show "Connecting to CompuServe Network";
Tries = 7;
on cancel goto Return_Cancel;
FirstTry = %TRUE;
FailStr = "";
ETX = "^C";
CompuServeHost = "CPS^M";
ifndef %X121Address = "";
ifndef %OKCmd = "";
ifndef %StopAtHost = "";
Start_Connect:
if Tries = 0 goto CIS_Failure;
Tries = Tries - 1;
Connect_Wait:
wait
"UIC:" goto Send_ETX,
"Host Name:" goto Send_Host_Name,
"User ID:" goto Send_ID,
"Password:" goto Send_Password,
"XPAD" goto Send_XPAD
until 80;
if not DirectConnect goto Send_CR;
sendm "###";
Send_CR:
send %CR;
goto Start_Connect;
Send_ETX:
send ETX;
goto Connect_Wait;
Send_Host_Name:
if Arg2 goto No_Wait;
wait until 10;
No_Wait:
if %StopAtHost = "" goto Send_No_Stop;
if %StopAtHost = "1" goto Return_Success;
send CompuServeHost;
goto Return_Success;
Send_No_Stop:
send CompuServeHost;
goto Connect_Wait;
Send_ID:
if %StopAtHost = "1" goto Force_Host;
show "Logging onto CompuServe";
send %UserID & %LogonParams & "/INT\" & %Password & %CR;
goto Logon_Wait;
Force_Host:
send "/HOST" & %CR;
goto Connect_Wait;
Send_XPAD:
send %X121Address & %CR;
goto Connect_Wait;
Send_Password:
send %Password;
Logon_Wait:
wait
"CompuServe" goto Return_Success,
"^[[>" goto Return_Success,
"^F" goto Return_Success,
"? LOG" goto Process_Log_Msg,
"??LOG" goto Process_Log_Msg,
" NTW" goto Logon_Failure,
"OK^M" goto Send_OK_Cmd,
"^[I" goto Send_Response
until 200;
goto CIS_Failure;
Process_Log_Msg:
wait
"INE" goto Bad_ID,
"ISX" goto Bad_ID_Syntax,
"CAI" goto Cannot_Auto_Irun,
"SIL" goto System_Unavailable,
"SIU" goto System_Unavailable,
"SNA" goto System_Unavailable,
"STU" goto System_Unavailable,
"UTL" goto Too_Many_Users
until 50;
goto Try_Again;
Too_Many_Users:
define %FailureMsg = "Simultaneous users exceeded";
exit %Failure;
Cannot_Auto_Irun:
define %FailureMsg = "Cannot Auto Irun HMI server";
exit %Failure;
Bad_ID:
FailStr = "Incorrect User ID or password";
goto Try_Again;
Bad_ID_Syntax:
FailStr = "Incorrect User ID syntax";
goto Try_Again;
System_Unavailable:
define %FailureMsg = "The system is unavailable, try again later";
exit %Fatal;
Try_Again:
if not FirstTry goto CIS_Fatal;
send ETX;
FirstTry = %FALSE;
wait
"User ID" goto Send_ID
until 140;
goto CIS_Fatal;
Logon_Failure:
define %FailureMsg = "Remote is busy or unavailable";
exit %Fatal;
Send_OK_Cmd:
if %OKCmd = "" goto Logon_Wait;
send %OKCmd & %CR;
goto Logon_Wait;
Send_Response:
sendi %ESCIResponse;
exit %Success;
CIS_Failure:
if FailStr <> "" goto Return_Fail_Msg;
define %FailureMsg = "Unable to connect to CompuServe host";
exit %Failure;
CIS_Fatal:
if FailStr <> "" goto Return_Fatal_Msg;
define %FailureMsg = "Unable to connect to CompuServe host";
exit %Fatal;
Return_Fail_Msg:
define %FailureMsg = FailStr;
exit %Failure;
Return_Fatal_Msg:
define %FailureMsg = FailStr;
exit %Fatal;
Return_Success:
exit %Success;
Return_Cancel:
exit %Cancel;